/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <cstdio>

using namespace std;

int main_82()
{
    int n,ans=1%1007;
    scanf("%d",&n);
    for (int i=0;i<n ;++i )
    {
        ans=(ans*2)%1007;
    }
    printf("%d\n",ans);
	return 0;
}
